<%@ taglib prefix="C" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: ssw
  Date: 2018/6/12
  Time: 10:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="Java" contentType="text/html; charset=utf-8" %>

<html>
<head>
    <%--<meta http-equiv="Content-Type" content="text/html; charset=utf-8">--%>
    <title>学生成绩管理系统v1.0-管理员界面</title>
</head>
<body>
欢迎您：${user.uname}(${user.uid})</br>
<h1>添加学生</h1></br>
<a href="/sgms/adminUI.jsp"> 回到上一页 </a></br>
<c:if test="${empty classList}">
    <jsp:forward page="/askclass">
        <jsp:param name="from" value="admin_addCourse"></jsp:param>
    </jsp:forward>
</c:if>
<form action="/addStudent">
    <tr>
        <td>学号：</td>
        <td><input type="text" name="sid"></td>
    </tr>
    <tr>
        <td>姓名：</td>
        <td><input type="text" name="sname"></td>
    </tr>
    <tr>
        <td>班级：</td>
        <td>
            <select name="clname">
                <c:forEach items="${classList}" var="cls">
                    <option value=${cls.clname}>${cls.clname}</option>
                </c:forEach>
            </select>
        </td>
    </tr>
    <input type="submit" value="提交">
</form>
<%
    if(request.getParameter("res")!=null){
        if(request.getParameter("res").equals("1")){
            out.println("插入学生成功");
        }
        else{
            out.println("插入学生失败");
        }
    }
%>
</body>
</html>
